package tests;

import static org.junit.Assert.*;

import org.junit.Test;

import src.MyMergeSort;

public class MyMergeSortTest {

	@Test
	public void testMain() {

		MyMergeSort.main(null);

	}

	@Test
	public void testSort() {

		MyMergeSort m = new MyMergeSort();
		int[] array1 = { 5, 4, 3, 2 };
		m.sort(array1);
		assertArrayEquals(array1, new int[] { 2, 3, 4, 5 });

		int[] array2 = { 5, 7, 9, 2 };
		m.sort(array2);
		assertArrayEquals(array2, new int[] { 2, 5, 7, 9 });

		int[] array3 = {};
		m.sort(array3);
		assertArrayEquals(array3, new int[] {});

	}
}
